package com.ph.website.home.controller;

import com.ph.website.home.base.common.CommonResult;
import com.ph.website.home.param.HelpSupportParam;
import com.ph.website.home.service.IHelpSupportService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.validation.Valid;

@RestController
@RequestMapping("/api/helpSupport")
public class HelpSupportController {

    @Resource
    private IHelpSupportService helpSupportService;

    /**后台查询列表*/
    @RequestMapping("/list")
    public CommonResult list(@Valid HelpSupportParam.ListParam param){
        return helpSupportService.list(param);
    }

    /**添加*/
    @RequestMapping("/add")
    public CommonResult add(@Valid HelpSupportParam.AddParam param){
        return helpSupportService.add(param);
    }

    /**修改*/
    @RequestMapping("/modify")
    public CommonResult modify(@Valid HelpSupportParam.ModifyParam param){
        return helpSupportService.modify(param);
    }

    /**删除*/
    @RequestMapping("/delete")
    public CommonResult delete(@Valid HelpSupportParam.DeleteParam param){
        return helpSupportService.delete(param);
    }

    /**发布*/
    @RequestMapping("/publish")
    public CommonResult publish(@Valid HelpSupportParam.PublishParam param){
        return helpSupportService.publish(param);
    }

    /**取消发布*/
    @RequestMapping("/unPublish")
    public CommonResult unPublish(@Valid HelpSupportParam.UnPublishParam param){
        return helpSupportService.unPublish(param);
    }
}
